package com.wty.gw.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wty.gw.util.PageParamReq;
import com.wty.gw.dao.AboutMapper;
import com.wty.gw.model.Do.AboutDO;
import com.wty.gw.model.query.AboutQuery;
import com.wty.gw.service.AboutService;
import com.wty.gw.model.vo.AboutVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class AboutServiceImpl implements AboutService{

	@Autowired
    private AboutMapper aboutMapper;

    @Override
    public void add(AboutDO aboutDo) {
        aboutMapper.insert(aboutDo);
    }

    @Override
    public void delete(Long id) {
        aboutMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void update(AboutDO aboutDo) {
        aboutMapper.updateByPrimaryKeySelective(aboutDo);
    }

    @Override
    public PageInfo<AboutVo> listByPage(AboutQuery aboutQuery) {
        PageHelper.startPage(aboutQuery.getPageNo(), aboutQuery.getPageSize());

        return new PageInfo(aboutMapper.listBycompanyId(aboutQuery));
    }

    @Override
    public AboutDO get(Long id) {
        return aboutMapper.selectByPrimaryKey(id);
    }
	
	
	
	
	
	
}